﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Threading;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Zad4
{
    public partial class Form1 : Form
    {
        logika logic;
        public Form1()
        {
            InitializeComponent();
            logic = new logika();
            logic.serw.Changed += updateForm;
        }

        public void updateForm()
        {
            Invoke((MethodInvoker)delegate()
            {
                label1.Text = logic.serw.text1;
                label2.Text = logic.serw.text2;
                label3.Text = logic.serw.text3;
            });
        }

        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            logic.killWatki();
        }
    }

}
